﻿using ReflectionStudio.Core.Events;
using System;
using System.ComponentModel;
using System.Data;
using System.Windows;
using System.Windows.Controls;
namespace WPFExcelReport
{
    public partial class TPWS02:UIWS
    {  
        public TPWS02()
        {
            if (DesignerProperties.GetIsInDesignMode(this))
                return;
            MV = new VWASTAMM();
            this.DataContext = MV;
            InitializeComponent(); 
        }
        public override void vwMaster_CurrentChanged(object sender, EventArgs e)
        {
            base.vwMaster_CurrentChanged(sender, e);
            dwWS = dwMaster;
            if (dwMaster == null)
            {
                KEY = "";
                TXTISIND = "";
            }
            else
            {
                KEY = TMV.WAART + TMV.WAVAR;
                TXTISIND = ("00000000      " + TMV.WAART + TMV.WAVAR).PadRight(60);
            }
        }
        public override void QueryCommand(object sender, System.Windows.RoutedEventArgs e)
        { 
            base.QueryCommand(sender, e);
            dwData = TBMain.NewRow();
            dwData["WAMANDANT"] = app.Mandant; 
            dwData["WAART"] =ART.Trim();
            dwData["WABEZ"] =DES.Trim(); 
            SResult = ((VWASTAMM)MV).QueryWASTAMM(dwData, 10);
            MergeData(SResult,true); 
        } 
         
    }
}
